<template>
  <div>
    <button @click="userAddChartCourse(220)">加入购物车</button>
    <router-link to="/chart">查看购物车</router-link>
  </div>
</template>

<script>
import {addChartCourse} from '@/api/request'
export default {
  name: 'DemoView',
  data () {
    return {
    }
  },
  methods: {
    userAddChartCourse(courseId) {
      addChartCourse(courseId).then(res => {
        console.log('加入购物车成功',res)
      }).catch(err=>{
        console.log(err);
        
      })
    }
  },
}
</script>

<style  scoped>

</style>
